#define _CRT_SECURE_NO_WARNINGS 
#include <stdio.h>

int main() {
    char arr[100] = { '\0' };
    scanf("%s", arr);
    int i = 0, a = 0, b = 0;
    while (arr[i] != '0') {
        if (arr[i] == 'A')
            a++;
        else b++;
        i++;
    }
    if (a > b)
        printf("A");
    else if (a < b)
        printf("B");
    else printf("E");
    return 0;
}